//
//  MyDocument.h
//  Secret Santa
//
//  Created by Andrew Cain on 12/10/07.
//  Copyright __MyCompanyName__ 2007 . All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "SSStatusMessage.h"

@class SSChristmas;

@interface MyDocument : NSPersistentDocument <StatusMessageDelegate>
{
	SSChristmas						*christmas;
	NSMutableArray					*statusMessages;
	BOOL							prepared;
	NSModalSession					session;
	
	IBOutlet NSTableView			*personTableView;
	IBOutlet NSTableView			*cannotGiveTableView;
	
	IBOutlet NSPanel				*sendingMailPanel;
	IBOutlet NSProgressIndicator	*progressBar;
	
	IBOutlet NSArrayController		*personArrayController;
	IBOutlet NSArrayController		*cannotGiveArrayController;	
	IBOutlet NSArrayController		*statusArrayController;
	
	IBOutlet NSObjectController		*currentPerson;
}

- (NSArray *) statusMessages;

- (void) setChristmas:(SSChristmas *)value;
- (SSChristmas *) christmas;

- (BOOL) prepared;

// Actions
- (IBAction) prepareMatches: (id) sender;
- (IBAction) sendEmail: (id) sender;

// Drag & Drop
- (BOOL)	tableView:(NSTableView *)tv 
 writeRowsWithIndexes:(NSIndexSet *)rowIndexes 
		 toPasteboard:(NSPasteboard*)pboard;

- (NSDragOperation)tableView:(NSTableView*)tv 
				validateDrop:(id <NSDraggingInfo>)info
				 proposedRow:(int)row
	   proposedDropOperation:(NSTableViewDropOperation)op;

- (BOOL)tableView:(NSTableView *)aTableView 
	   acceptDrop:(id <NSDraggingInfo>)info
			  row:(int)row 
	dropOperation:(NSTableViewDropOperation)operation;


// Status Message Delegate
- ( void ) setIncrementCountTo: (int) value;
- ( void ) incrementProgress;
- ( void ) addStatus: ( NSString * ) message;
- ( void ) changeStatus: ( BOOL ) success;


@end
